import $ from "@/utils/request"
// 首页数据
const getHomeApi = () => $.getAxios('homeApi.json')

//左侧侧边栏数据
const getCategoryApi = () => $.getAxios('/homeApi/categories.json')

//分类页数据
//num是点击选项时所对应的下标
const getCategoryApI = () => $.getAxios('/homeApi/categoriesdetail')

//吃什么头部数据
const getWhatToEat = () => $.getAxios('/recipe/allScene.json')

//吃什么内容数据
const getWhatToEat1 = () => {
    return $.getAxios('/recipe/menulist')
}

// mockjs模拟登录接口
// 注册
const postRegister = ({ tel = null, password = null } = {}) => $.postAxios('register', { tel, password })

// 登录
const postLogin = ({ tel = null, password = null, yzm = null, sms = null } = {}) => $.postAxios('login', { tel, password, yzm, sms })
export default {
    // 首页数据
    getHomeApi,
    postRegister,
    //登录
    postLogin,
    //左侧侧边栏数据
    getCategoryApi,
    //分类页数据
    getCategoryApI,
    getWhatToEat1,
    getWhatToEat
}